package com.study.hot.jetpack

import com.study.base.BaseActivity
import com.study.hot.R
import com.study.hot.jetpack.livedata.DataBindingLiveDataActivity
import com.study.hot.jetpack.demo_shopping.MainActivity
import com.study.hot.jetpack.lifecycle.LifecycleActivity
import com.study.hot.jetpack.livedata.LiveDataActivity
import com.study.hot.jetpack.livedata.ScoreActivity
import com.study.hot.jetpack.navigation.GoodsActivity
import com.study.hot.jetpack.navigation.NavigationActivity
import com.study.hot.jetpack.paging.PagingActivity
import com.study.hot.jetpack.room.RoomActivity
import com.study.hot.jetpack.demo_words.WordsActivity
import com.study.hot.jetpack.hilt.HiltActivity
import com.study.hot.jetpack.paging.Paging3Activity
import com.study.hot.jetpack.viewmodel.ViewModelActivity
import com.study.hot.jetpack.viewmodel.ViewModelSaveStateActivity
import kotlinx.android.synthetic.main.activity_jetpack_main.*
import org.jetbrains.anko.sdk27.coroutines.onClick
import org.jetbrains.anko.startActivity

/**
 * <pre>
 *     author : fauks
 *     time   : 2020/03/24
 *     desc   :
 * </pre>
 */
class JetpackMainActivity : BaseActivity() {
    override fun generateLayoutId() = R.layout.activity_jetpack_main

    override fun initView() {
        toViewModelBtn.onClick {
            startActivity<ViewModelActivity>()
        }

        toViewModelSaveStateBtn.onClick {
            startActivity<ViewModelSaveStateActivity>()
        }

        toLiveDataBtn.onClick {
            startActivity<LiveDataActivity>()
        }

        toDatabindingBtn.onClick {
            startActivity<DataBindingLiveDataActivity>()
        }

        toNavigationBtn.onClick {
            startActivity<NavigationActivity>()
        }

        toNavigationGoodsBtn.onClick {
            startActivity<GoodsActivity>()
        }

        toRoomBtn.onClick {
            startActivity<RoomActivity>()
        }

        toWordsBtn.onClick {
            startActivity<WordsActivity>()
        }

        toLifecycleBtn.onClick {
            startActivity<LifecycleActivity>()
        }

        toPagingBtn.onClick {
            startActivity<PagingActivity>()
        }

        toPaging3Btn.onClick {
            startActivity<Paging3Activity>()
        }

        toDemoBtn.onClick {
            //startActivity<LoginActivity>()
            startActivity<MainActivity>()
        }

        toDemo2Btn.onClick {
            startActivity<ScoreActivity>()
        }

        toHiltBtn.onClick {
            startActivity<HiltActivity>()
        }
    }


}